﻿using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
using HCD.His;
using HCD.His.Dtos;

namespace HCD.Web.Controllers.ApiControllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class HISController : EnterpriseControllerBase
    {
        public IHisAppService HisAppService { get; set; }

        /// <summary>
        /// 获取病人医嘱
        /// </summary>
        /// <param name="input">查询条件，PatientId VisitId</param>
        /// <returns></returns>
        [HttpPost]
        public async Task<List<HisOrdersDto>> GetPatHisOrdersDto([FromBody]HisOrdersGetInput input)
        {
            return await HisAppService.GetPatHisOrdersDto(input);
        }


        /// <summary>
        /// 获取病人手术
        /// </summary>
        /// <param name="input">查询条件，PatientId VisitId</param>
        /// <returns></returns>
        [HttpPost]
        public async Task<List<HisOperationDto>> GetPatHisOperationDto([FromBody]HisOperationGetInput input)
        {
            return await HisAppService.GetPatHisOperationDto(input);
        }

        /// <summary>
        /// 获取病人检查申请单
        /// </summary>
        /// <param name="input">查询条件，PatientId VisitId</param>
        /// <returns></returns>
        [HttpPost]
        public async Task<List<HisExamDto>> GetPatHisExamDto([FromBody]HisExamGetInput input)
        {
            return await HisAppService.GetPatHisExamDto(input);
        }


        /// <summary>
        /// 获取病人检查结果
        /// </summary>
        /// <param name="input">查询条件，ExamNo  ReportNo</param>
        /// <returns></returns>
        [HttpPost]
        public async Task<List<HisExamReportDto>> GetPatHisExamReportDto([FromBody]HisExamReportGetInput input)
        {
            return await HisAppService.GetPatHisExamReportDto(input);
        }

        /// <summary>
        /// 获取病人检验申请单
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<List<HisLabTestDto>> GetPatHisLabTestDto(HisLabTestGetInput input)
        {
            return await HisAppService.GetPatHisLabTestDto(input);
        }


        /// <summary>
        /// 获取病人检查结果
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<List<HisLabResultDto>> GetPatHisLabResultDto(HisLabResultGetInput input)
        {
            return await HisAppService.GetPatHisLabResultDto(input);
        }
    }
}